-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
server: add test for /debug/sub-optimal-plan
HTTP API
#14302
Conversation
/run-all-tests |
/run-unit-test |
@@ -255,14 +273,8 @@ func (sh *sqlInfoFetcher) getExplainAnalyze(ctx context.Context, sql string, res | |||
resultChan <- &explainAnalyzeResult{rows: rows} | |||
} | |||
|
|||
func (sh *sqlInfoFetcher) catchCPUProfile(ctx context.Context, sec int, zw *zip.Writer, errChan chan<- error) { | |||
// dump profile | |||
fw, err := zw.Create("profile") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Call zw.Create("profile")
in dumpCPUProfile()
instead of catchCPUProfile()
,
For avoiding data race with
tidb/server/sql_info_fetcher.go
Line 207 in 5d76de9
fw, err := zw.Create("explain_analyze.txt") |
c.Assert(len(b), Greater, 0) | ||
c.Assert(resp.Body.Close(), IsNil) | ||
|
||
resp, err = http.PostForm("http://127.0.0.1:10090/debug/sub-optimal-plan?pprof_time=5&timeout=0", urlValues) | ||
c.Assert(err, IsNil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add more test for pprof_time & timeout & urlValues . like
- only use single pprof_time or single timeout
- set wrong 'curDB'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/run-all-tests |
Rest LGTM |
/run-all-tests |
/run-unit-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Your auto merge job has been accepted, waiting for 14200, 14035, 14275, 14229, 14357 |
/run-all-tests |
What problem does this PR solve?
Improving unit test coverage of
server
package.What is changed and how it works?
add test for
/debug/sub-optimal-plan
HTTP API, This API added by #10717Before this PR:
After this PR:
Check List
Tests
Code changes
Side effects
The test time of
server
package increased from 25s to 30s.Related changes
Release note